﻿//using SqlPerfomance.V2.DAL;
//using SqlPerfomance.V2.DomainModel.Models;
//using SqlPerfomance.V2.DomainModel.NodeTree.Interfaces;
//using SqlPerfomance.V2.Tests.Code;
//using SqlPerfomance.V2.Tests.TestsCommand;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace SqlPerfomance.V2.Tests
//{
//    public class TestsManager
//    {
//        private IEnumerable<TestSettings> _settings;
//        private List<ITestCommand> _testCommands;
//        public TestsManager(IEnumerable<TestSettings> testsSettings)
//        {
//            if (testsSettings == null)
//                throw new ArgumentNullException("testsSettings");

//            _settings = testsSettings;
//            _testCommands = new List<ITestCommand>();
//            _testCommands.Add(new MpTestsCommand();
//            _testCommands.Add(typeof(AlTestsCommand));
//        }

//        public IEnumerable<TestCommandResult> RunAllTests()
//        {
//            var list = new List<TestCommandResult>();
//            var commonRepo = new CommonTreeRepository();
//            foreach (var settings in _settings)
//            {
//                var commonTree = commonRepo.CreateCommonTree(settings.NodesCount, settings.NestingLevel);
//                foreach (var tests in _testCommands)
//                {
//                    var test = Activator.CreateInstance(tests, settings) as ITestCommand;
//                    if (test == null) continue;
//                    list.Add(test.RunTests((INode<CommonTreeNode>)commonTree));
//                }
//            }
//            return list;
//        }
//    }
//}
